package com.pti.usermanager.web.controller;

import com.pti.usermanager.service.api.LoginService;
import com.pti.usermanager.web.dto.response.ResultResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName: LoginController
 * @Author: liumengyao
 * @Description:
 * @Date: 2019/2/18
 */
@RestController
@Api(value = "登陆管理接口", tags = "提供登陆的管理接口")
public class LoginController {

    @Autowired
    private LoginService loginService;


    @PostMapping("/login")
    @ApiOperation(value = "通过用户名登陆", notes = "通过用户名登陆", produces = "application/json")
    public ResultResponse loginByLoginName(@RequestParam("loginNm") String loginNm,
                                           @RequestParam("usrPwd") String usrPwd){
        return loginService.loginByLoginName(loginNm,usrPwd);
    }
}
